import request from '@/utils/request'

const baseUrl = '/auth/api/v1'

/**
 * 管理员登录（账号密码）
 */
export const login = (data) => {
  return request.post(`${baseUrl}/auth/login`, data)
}

/**
 * 微信扫码登录 - 获取授权URL
 */
export const getWechatAuthUrl = () => {
  return request.get(`${baseUrl}/wechat/auth-url`)
}

/**
 * 获取当前管理员信息
 */
export const getCurrentAdmin = () => {
  return request.get(`${baseUrl}/auth/current`)
}

/**
 * 刷新Token
 */
export const refreshToken = () => {
  return request.post(`${baseUrl}/auth/refresh`)
}

/**
 * 退出登录
 */
export const logout = () => {
  return request.post(`${baseUrl}/auth/logout`)
}

